<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>跳水板</title>
</head>
<body>
  <script>
    function fn(shorter, longer, k) {
      if (k === 0) return []
      // 如果长短都一样，那就只有一种结果．k块长的，或k块短的．
      if (shorter === longer) {
        return [k * longer]
      }
      var arr = []
      for (var i = 0; i <= k; i++) {
        // 如果有i块长的，短的必然是k - i块．
        arr.push(i * longer + (k - i) * shorter)
      }
      return arr
    }
    console.log(fn(1, 2, 3))
  </script>
</body>
</html>